﻿
using UtilPublic.ServerLoger;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UtilLib;

namespace ConfClient
{
    /// <summary>
    /// 策划设置配置
    /// </summary>
    public static partial class Conf
    {
        // 当前语言版本
        static public ELanguage Language = ELanguage.中文简体;

        /// <summary>
        /// 配置后续处理
        /// </summary>
        /// <returns></returns>
        public static bool InitConfSettingsExt()
        {
            CfgGlobal = ConfGlobal.ToDictionary
                (it => (EGlobalId)it.Value.GlobalId, it => new GlobalConfigExt(it.Value));

            ConfSurnameExt.Clear();
            ConfMalenameExt.Clear();
            ConfFemalenameExt.Clear();
            ConfBadwordsExt.Clear();
            switch (Language)
            {
                case ELanguage.英语:
                    foreach (var item in ConfNameSur.Values) { ConfSurnameExt.Add(item.LangEn); }
                    foreach (var item in ConfNameMale.Values) { ConfMalenameExt.Add(item.LangEn); }
                    foreach (var item in ConfNameFemale.Values) { ConfFemalenameExt.Add(item.LangEn); }
                    //foreach (var item in ConfBadwords.Values) { ConfBadwordsExt.Add(item.LangEn); }
                    break;
                default:
                    foreach (var item in ConfNameSur.Values) { ConfSurnameExt.Add(item.LangChs); }
                    foreach (var item in ConfNameMale.Values) { ConfMalenameExt.Add(item.LangChs); }
                    foreach (var item in ConfNameFemale.Values) { ConfFemalenameExt.Add(item.LangChs); }
                    foreach (var item in ConfNameBad.Values) { ConfBadwordsExt.Add(item.LangChs); }
                    break;
            }

            ConfListFamilyExt = ConfFamily.Keys.ToList();

            return true;
        }

    }

}